package com.demo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author yexi
 */
@SpringBootApplication
@Slf4j
public class ServerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ServerApplication.class, args);
        Integer port = run.getBean(ServerProperties.class).getPort();
        log.info("服务已启动，server port: {}", port);
    }

}
